package cn.tedu.review;

import java.util.Arrays;

public class TestArray {
    public static void main(String[] args) {
        int[] from={1,2,3,4,5};
        int[] to= Arrays.copyOf(from,5);
        System.out.println(Arrays.toString(to));
        int[] to2 =Arrays.copyOf(from,10);
        System.out.println(Arrays.toString(to2));

        int[] to3 =Arrays.copyOf(from,3);
        System.out.println(Arrays.toString(to3));
        int[] to4 =Arrays.copyOfRange(from,2,4);
        System.out.println(Arrays.toString(to4));
    }
}
